Link history types properties?

Other than the obvious property types for Link History such as targetAbsNo does anybody have these documented somewhere? I'm trying to determine the target Module for a history record and have tried the obvious possibilites to no avail.

TIA,
Chris in VA
Chris_Welch - Wed Mar 04 15:50:52 EST 2009

Re: Link history types properties?
SystemAdmin - Thu Mar 05 03:56:17 EST 2009

You can get the target module (targetInitialName) from link history, by you need to logged in as Administrator. I have a DXL script which shows the other possible history items (do not remember who has written this, it is probably copied off the old forum).

// Deleted link history
/*
Re-create links from link deletion history.
*/

// MODIFY THESE VALUES BEFORE RUNNING THIS SCRIPT AS ADMINISTRATOR
//------------------------------------------------------------------------------------------

// Modify the date down to we will re-create the links, no deleted links before this
// will be restored
Date CheckUpDate = "20/01/2008"

// If OptionaLinkModule is not empty, then that specific link module will be used for
// creating links instead of the one defined in history
string OptionalLinkModule = "/EasyStart/Requirements/DOORS Links"

// If DeletedFromLinkModule is not empty, then only that specific link module
// will be used for finding deleted links - no other links will be restored
string DeletedFromLinkModule = "/EasyStart/Requirements/DOORS Links"

//------------------------------------------------------------------------------------------
// DO NOT MODIFY ANYTHING AFTER THIS LINE
Object o = null
Module currMod = current
Module trgMod = null

string TargetModule = ""
string LinkModule = ""
int TargetAbs = 0
Object TargetObject = null

History h = null
HistoryType ht = null

User currUser = null
UserClass currUserClass

Link l = null
int NumLinksRestored = 0

// Procedures

void GetLinkHistory(History h)

{
LinkModule = h.linkInitialName //requires Admin Rights, gets the full name
//to the link module of the deleted link

TargetAbs = h.targetAbsNo //doesn't need Admin Rights, gets the deleted
//target's Absolute Number

TargetModule = h.targetInitialName //requires Admin Rights, gets the full name
//to the target module of the deleted links target
}

// Main program
currUser = find()
currUserClass = currUser.class
if (stringOf(currUserClass) != "Administrator")
{
ack "Only the Administrator user can run this script"
halt
}

if ((null currMod) || (!isEdit currMod))
{
ack "Please run this script from a module in exlusive edit mode"
halt
}

for o in currMod do
{
for h in o do
{
ht = h.type
if ((ht==deleteLink) && (h.date > CheckUpDate))
{
GetLinkHistory(h)
if (DeletedFromLinkModule > "")
{
if (DeletedFromLinkModule != LinkModule) continue
}
// Use the original link module, but if the optional has some content, then use it
if (OptionalLinkModule > "")
{
LinkModule = OptionalLinkModule
}
if ((exists module LinkModule) && (!isDeleted module LinkModule) &&
(exists module TargetModule) && (!isDeleted module TargetModule))
{
trgMod = read(TargetModule, false)
if (!null trgMod)
{
current = trgMod
filtering off
sorting off
current = currMod
TargetObject = object(TargetAbs, trgMod)
if (!null TargetObject)
{
l = o -> LinkModule -> TargetObject
if (!null l)
{
NumLinksRestored++
}
else
{
ack "Could not create link from " o."Absolute Number" " to " TargetModule " object " TargetAbs ""
}
}
else
{
ack "Null target object " TargetAbs " in module " TargetModule ""
}
}
}
}
}
}

// Save the module
save currMod

// Close all the module, except current one
for trgMod in database do
{
if ((!null trgMod) && (trgMod != currMod))
{
close trgMod
}
}

infoBox "Done! " NumLinksRestored " links were re-created from history back to " CheckUpDate ""

Re: Link history types properties?
Chris_Welch - Thu Mar 05 09:23:48 EST 2009

SystemAdmin - Thu Mar 05 03:56:17 EST 2009
You can get the target module (targetInitialName) from link history, by you need to logged in as Administrator. I have a DXL script which shows the other possible history items (do not remember who has written this, it is probably copied off the old forum).

// Deleted link history
/*
Re-create links from link deletion history.
*/

// MODIFY THESE VALUES BEFORE RUNNING THIS SCRIPT AS ADMINISTRATOR
//------------------------------------------------------------------------------------------

// Modify the date down to we will re-create the links, no deleted links before this
// will be restored
Date CheckUpDate = "20/01/2008"

// If OptionaLinkModule is not empty, then that specific link module will be used for
// creating links instead of the one defined in history
string OptionalLinkModule = "/EasyStart/Requirements/DOORS Links"

// If DeletedFromLinkModule is not empty, then only that specific link module
// will be used for finding deleted links - no other links will be restored
string DeletedFromLinkModule = "/EasyStart/Requirements/DOORS Links"

//------------------------------------------------------------------------------------------
// DO NOT MODIFY ANYTHING AFTER THIS LINE
Object o = null
Module currMod = current
Module trgMod = null

string TargetModule = ""
string LinkModule = ""
int TargetAbs = 0
Object TargetObject = null

History h = null
HistoryType ht = null

User currUser = null
UserClass currUserClass

Link l = null
int NumLinksRestored = 0

// Procedures

void GetLinkHistory(History h)

{
LinkModule = h.linkInitialName //requires Admin Rights, gets the full name
//to the link module of the deleted link

TargetAbs = h.targetAbsNo //doesn't need Admin Rights, gets the deleted
//target's Absolute Number

TargetModule = h.targetInitialName //requires Admin Rights, gets the full name
//to the target module of the deleted links target
}

// Main program
currUser = find()
currUserClass = currUser.class
if (stringOf(currUserClass) != "Administrator")
{
ack "Only the Administrator user can run this script"
halt
}

if ((null currMod) || (!isEdit currMod))
{
ack "Please run this script from a module in exlusive edit mode"
halt
}

for o in currMod do
{
for h in o do
{
ht = h.type
if ((ht==deleteLink) && (h.date > CheckUpDate))
{
GetLinkHistory(h)
if (DeletedFromLinkModule > "")
{
if (DeletedFromLinkModule != LinkModule) continue
}
// Use the original link module, but if the optional has some content, then use it
if (OptionalLinkModule > "")
{
LinkModule = OptionalLinkModule
}
if ((exists module LinkModule) && (!isDeleted module LinkModule) &&
(exists module TargetModule) && (!isDeleted module TargetModule))
{
trgMod = read(TargetModule, false)
if (!null trgMod)
{
current = trgMod
filtering off
sorting off
current = currMod
TargetObject = object(TargetAbs, trgMod)
if (!null TargetObject)
{
l = o -> LinkModule -> TargetObject
if (!null l)
{
NumLinksRestored++
}
else
{
ack "Could not create link from " o."Absolute Number" " to " TargetModule " object " TargetAbs ""
}
}
else
{
ack "Null target object " TargetAbs " in module " TargetModule ""
}
}
}
}
}
}

// Save the module
save currMod

// Close all the module, except current one
for trgMod in database do
{
if ((!null trgMod) && (trgMod != currMod))
{
close trgMod
}
}

infoBox "Done! " NumLinksRestored " links were re-created from history back to " CheckUpDate ""

Thanks!!!
h.linkInitialName and h.targetInitialName were the 2 missing pieces of the puzzle!!!

Target Object Identifier
faisal.zahidi@boeing.com - Tue Jan 19 17:41:43 EST 2010

SystemAdmin - Thu Mar 05 03:56:17 EST 2009
You can get the target module (targetInitialName) from link history, by you need to logged in as Administrator. I have a DXL script which shows the other possible history items (do not remember who has written this, it is probably copied off the old forum).

// Deleted link history
/*
Re-create links from link deletion history.
*/

// MODIFY THESE VALUES BEFORE RUNNING THIS SCRIPT AS ADMINISTRATOR
//------------------------------------------------------------------------------------------

// Modify the date down to we will re-create the links, no deleted links before this
// will be restored
Date CheckUpDate = "20/01/2008"

// If OptionaLinkModule is not empty, then that specific link module will be used for
// creating links instead of the one defined in history
string OptionalLinkModule = "/EasyStart/Requirements/DOORS Links"

// If DeletedFromLinkModule is not empty, then only that specific link module
// will be used for finding deleted links - no other links will be restored
string DeletedFromLinkModule = "/EasyStart/Requirements/DOORS Links"

//------------------------------------------------------------------------------------------
// DO NOT MODIFY ANYTHING AFTER THIS LINE
Object o = null
Module currMod = current
Module trgMod = null

string TargetModule = ""
string LinkModule = ""
int TargetAbs = 0
Object TargetObject = null

History h = null
HistoryType ht = null

User currUser = null
UserClass currUserClass

Link l = null
int NumLinksRestored = 0

// Procedures

void GetLinkHistory(History h)

{
LinkModule = h.linkInitialName //requires Admin Rights, gets the full name
//to the link module of the deleted link

TargetAbs = h.targetAbsNo //doesn't need Admin Rights, gets the deleted
//target's Absolute Number

TargetModule = h.targetInitialName //requires Admin Rights, gets the full name
//to the target module of the deleted links target
}

// Main program
currUser = find()
currUserClass = currUser.class
if (stringOf(currUserClass) != "Administrator")
{
ack "Only the Administrator user can run this script"
halt
}

if ((null currMod) || (!isEdit currMod))
{
ack "Please run this script from a module in exlusive edit mode"
halt
}

for o in currMod do
{
for h in o do
{
ht = h.type
if ((ht==deleteLink) && (h.date > CheckUpDate))
{
GetLinkHistory(h)
if (DeletedFromLinkModule > "")
{
if (DeletedFromLinkModule != LinkModule) continue
}
// Use the original link module, but if the optional has some content, then use it
if (OptionalLinkModule > "")
{
LinkModule = OptionalLinkModule
}
if ((exists module LinkModule) && (!isDeleted module LinkModule) &&
(exists module TargetModule) && (!isDeleted module TargetModule))
{
trgMod = read(TargetModule, false)
if (!null trgMod)
{
current = trgMod
filtering off
sorting off
current = currMod
TargetObject = object(TargetAbs, trgMod)
if (!null TargetObject)
{
l = o -> LinkModule -> TargetObject
if (!null l)
{
NumLinksRestored++
}
else
{
ack "Could not create link from " o."Absolute Number" " to " TargetModule " object " TargetAbs ""
}
}
else
{
ack "Null target object " TargetAbs " in module " TargetModule ""
}
}
}
}
}
}

// Save the module
save currMod

// Close all the module, except current one
for trgMod in database do
{
if ((!null trgMod) && (trgMod != currMod))
{
close trgMod
}
}

infoBox "Done! " NumLinksRestored " links were re-created from history back to " CheckUpDate ""

I am trying to display all link history for each object in a layout dxl. The following code works fine except that I want to display the target object identifier not the absolute number (targetNum).

Is there any function for target object identifier. The data will be displayed in a layout dxl column. Everyone is not an Administrator. In other words the targetInitialName function can not be used.

Any suggestion is appreciated.

History h
int targetNum = 0
if ((h.type== modifyLink) || (h.type == createLink) || (h.type == deleteLink))
{
targetNum = h.targetAbsNo
displayRich "Changed on " h.date " By: " h.author "" "\t" "{\\b " stringOf(h.type) " to: } " targetNum ""

}

Regards